<template>
  <div>
    <div class="footer_wrap">
      <!-- <router-link to="/" exact>发现音乐</router-link>
      <router-link to="/my">我的音乐</router-link> -->
      <!-- <router-link to="/part?username=harry">朋友</router-link> -->
      <!-- <router-link to="/part/harry/123">朋友</router-link> -->

      <span @click="toRoute('/', 'find')">发现音乐</span>
      <span @click="toRoute('/my', 'my')">我的音乐</span>
      <span @click="toRoute('/part', 'part')">朋友</span>
    </div>
    <div class="top">
      <router-view></router-view>
    </div>
  </div>
</template>

<script>
export default {
  props: {},
  components: {},
  data() {
    return {}
  },
  methods: {
    toRoute(path, name) {
      // console.log(path)
      this.$router.push(
        {
          path,
          // name,
          query: {
            username: 'harry',
            password: 123,
          },
          params: {
            username: 'harry',
            password: '123',
          },
        },
        () => {},
        () => {}
      )
    },
  },
}
</script>

<style scoped>
.router-link-exact-active,
.router-link-active {
  background-color: #555 !important;
}

.footer_wrap {
  position: fixed;
  left: 0;
  top: 0;
  display: flex;
  width: 100%;
  text-align: center;
  background-color: #333;
  color: #ccc;
}
.footer_wrap a,
.footer_wrap span {
  flex: 1;
  text-decoration: none;
  padding: 20px 0;
  line-height: 20px;
  background-color: #333;
  color: #ccc;
  border: 1px solid black;
}
.footer_wrap a:hover,
.footer_wrap span:hover {
  background-color: #555;
}
.top {
  padding-top: 62px;
}

.active,
.active-exact {
  background-color: olive !important;
  color: #fff !important;
}
</style>
